package io.lkt.modules.sys.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.lkt.common.utils.PageUtils;
import io.lkt.common.utils.Query;

import io.lkt.modules.sys.dao.GzhMenuTemplateDao;
import io.lkt.modules.sys.entity.GzhMenuTemplateEntity;
import io.lkt.modules.sys.service.GzhMenuTemplateService;


@Service("gzhMenuTemplateService")
public class GzhMenuTemplateServiceImpl extends ServiceImpl<GzhMenuTemplateDao, GzhMenuTemplateEntity> implements GzhMenuTemplateService {

    @Autowired
    private GzhMenuTemplateDao gzhMenuTemplateDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<GzhMenuTemplateEntity> page = this.page(
                new Query<GzhMenuTemplateEntity>().getPage(params),
                new QueryWrapper<GzhMenuTemplateEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public GzhMenuTemplateEntity getGzhMenuTemplateByName(String templateName) {
        return gzhMenuTemplateDao.getGzhMenuTemplateByName(templateName);
    }

}
